package com.ling.module1sbbyyds.controller.err;


import com.ling.sbbyyds.interaction.ResultVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 定义错误返回
 */
@RestController
@RequestMapping("api/err/")
public class ErrController {

    /**
     * /err/noLogin
     * 用户未登录
     *
     * @return
     */
    @RequestMapping("noLogin")
    public ResultVo noLogin() {
        return ResultVo.fail(40001, "请先登录！");
    }

    /**
     * /err/errMsg
     * 错误提示
     *
     * @return
     */
    @GetMapping("errMsg")
    public ResultVo errMsg(Integer code, String msg) {
        return ResultVo.fail(code, msg);
    }

}
